<?php

namespace mpend\modules\h5\controllers;

use Yii;
use mpend\components\Controller;

/**
 * 登录、注册、找回密码相关接口
 * PassportController
 */
class PassportController extends Controller {

    /**
     * Declares the allowed HTTP verbs.
     * Please refer to [[VerbFilter::actions]] on how to declare the allowed verbs.
     * @return array the allowed HTTP verbs.
     */
    protected function verbs() {
        return [
            '*' => ['POST'],
        ];
    }

    /**
     * Declares the allowed HTTP verbs.
     * Please refer to [[VerbFilter::actions]] on how to declare the allowed verbs.
     * @return array the allowed HTTP verbs.
     */
    protected function rules() {
        return [
            [
                'allow' => true,
                'roles' => ['?'],
            ],
        ];
    }

    /**
     * 找回密码
     * @return mixed
     */
    public function actionForget() {
        return [
            'type' => 'request',
            'style' => 7,
            'mobile' => '151*****510',
            'email' => '18*******jf@163.com',
        ];
        return Yii::$app->request->post();
        $model = new ResetPasswordForm();
        if (!$model->load(Yii::$app->request->post(), '')) {
            parent::error('请输入用户注册所需要的信息');
        }
        return $model->signup();
    }

}
